package org.ras.util;

/**
 * Title: evils
 * CreateDate:  2018/2/1
 *
 * @author houdengw
 * @version 1.0
 */
public class ResultUtil {

    /**
     * 请求成功返回
     * @param object
     * @return
     */
    public static Result success(Object object){
        Result result=new Result();
        result.setCode(200);
        result.setMsg("请求成功");
        result.setData(object);
        return result;
    }

    /**
     * 请求成功不需要返回值
     * @return
     */
    public static Result success(){
        return success(null);
    }

    /**
     * 请求失败
     * @param code
     * @param resultmsg
     * @return
     */
    public static Result error(Integer code,String resultmsg){
        Result result=new Result();
        result.setCode(code);
        result.setMsg(resultmsg);
        return result;
    }
}
